#include "StdAfx.h"
#include "DD_RayCtrl.h"
#include "xhRayCtrl.h"


DD_RayCtrl::DD_RayCtrl(void)
{
	m_pxhRayCtrl = NULL;
}

DD_RayCtrl::~DD_RayCtrl(void)
{
	MySafeDelete(m_pxhRayCtrl);
}

#define DKQ_SECT {if( NULL== m_pxhRayCtrl ) return -1;}

int DD_RayCtrl::Initialize()
{
	if( NULL == m_pxhRayCtrl )
	{
		m_pxhRayCtrl = new xhRayCtrl;
	}

	DKQ_SECT
	return m_pxhRayCtrl->Initialize();
}

int DD_RayCtrl::UnInitialize()
{
	DKQ_SECT
	return m_pxhRayCtrl->UnInitialize();
}
//parent hwnd
int DD_RayCtrl::SetHwnd(HWND hWnd)
{
	DKQ_SECT
	return m_pxhRayCtrl->SetHwnd(hWnd);
}
int DD_RayCtrl::RegMsgCallBack(void *pfun, DWORD dwContext, void *pContext)
{
	DKQ_SECT;
	return m_pxhRayCtrl->RegMsgCallBack(pfun,dwContext,pContext);
}

int DD_RayCtrl::GetPlugList(zkPlugDescs **ppDescs)
{
	DKQ_SECT
	return m_pxhRayCtrl->GetPlugList(ppDescs);
}
//
int DD_RayCtrl::SelectPlug(char *pDescName)
{
	DKQ_SECT
	return m_pxhRayCtrl->SelectPlug(pDescName);
}

int DD_RayCtrl::OpParam(void *pVoid)
{
	DKQ_SECT
	return m_pxhRayCtrl->OpParam(pVoid);
}

int DD_RayCtrl::SetComCfg(zkComCfg *pCfg)
{
	DKQ_SECT
		return m_pxhRayCtrl->SetComCfg(pCfg);
}

int DD_RayCtrl::CheckConnect(int &nStatus)
{
	DKQ_SECT;
	return m_pxhRayCtrl->CheckConnect(nStatus);
}

int DD_RayCtrl::SetRayCfg(zkRayCfg *pCfg)
{
	DKQ_SECT
	return m_pxhRayCtrl->SetRayCfg(pCfg);
}

int DD_RayCtrl::SetRayCtrl(zkRayCtrl *pRayCtrl,BOOL bWaitToGo)
{
	DKQ_SECT
	return m_pxhRayCtrl->SetRayCtrl(pRayCtrl,bWaitToGo);
}

int DD_RayCtrl::GetRayCtrl(zkRayCtrl **ppRayCtrl)
{
	DKQ_SECT
	return m_pxhRayCtrl->GetRayCtrl(ppRayCtrl);
}